业余爱好,根据网上教程写的,主要是提高编程思路,有编程的过程说明,游戏本身不完美,思路还是可以学习一下
namespace TankGame
{
/// <summary>
/// 单例 类用来创建全局唯一的游戏对象
/// </summary>
class SingleObject
{
private SingleObject()
{
}
public static SingleObject _singleObject = null;
public static SingleObject GetSingle()
{
if (_singleObject == null)
{
_singleObject= new SingleObject();
}
return _singleObject;
}
//玩家坦克
public PlayerTank PT { get; set; }
//将敌人存储在泛型集合中
List<EnemyTank> listEnemyTank = new List<EnemyTank>();
//玩家和敌人子弹集合
List<PlayerZiDan> listPlayerZD = new List<PlayerZiDan>();
List<EnemyZiDan> listEnemyZD = new List<EnemyZiDan>();
List<Boom> listBoom = new List<Boom>();
List<TankBorn> listTankBorn = new List<TankBorn>();
List<ZhuangBei> listZhuanBei = new List<ZhuangBei>();
List<Wall> listWall = new List<Wall>();
评论